<div ng-if="pagedata.showareas && pagedata.showcity !=1" class="popup">
	<div class="popup-body">
		<div class="popup-bottom" style="border-radius:0.2rem;">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showareas=false"></i>
			<div class="fui-list-group" style="background:#fff;margin:0.6rem;height:26rem;overflow-y:scroll">
				<div class="fui-cellone" style="padding:0.3rem 0">
					<div class="fui-cellone-label bold">选择城市：</div>
					<div class="fui-cellone-text" ng-click="pagedata.showcity=1">
						<span>{{pagedata.params.city || '广州市'}}</span>
						<i class="icon jinyunicon icon-moreunfold"></i>
					</div>
				</div>
					<div class="fui-list"  ng-repeat="item in pagedata.areas" href="javascript:;" ng-click="pagedata.showareas=false;pagedata.selectareas(item);">
						<div class="fui-list-media">
							<i class="icon icon-map"></i>
						</div>
						<div class="fui-list-inner">
							<div class="subtitle" >
								<span class="red">{{item.title}}</span>
							</div>
							<div class="text address">地址：<span style="color:red">{{item.pcd.city}}</span>({{item.pcd.district}} {{item.pcd.street}} {{item.address}})
							<span ng-if="item.juli>0" style="font-size:0.6rem">{{item.juli||0}}KM</span>
							</div>
						</div>
						<div class="fui-list-angle">
							<div class="angle"></div>
						</div>
					</div>
					<div ng-if="!pagedata.areas || pagedata.areas.length<1" class='content-empty' style="margin-top:0">
						<i class='icon icon-ruzhuchenggongdapx' style="font-size:2rem"></i>
						<div style="padding-bottom:0.5rem">目前没有合适的经销商！</div>
					</div>
			</div>
		</div>
	</div>
</div>
<div class="fui-page  fui-page-current page-goods-list" ng-if="pagedata.showcity ==1">
<div class="fui-header">
		<div class="fui-header-left" ng-click="pagedata.showcity =0">
			<a class="back"></a>
		</div>
		<div class="title">
			<form method="post">
					<div class="searchbar searchbar-active">
					<div class="search-input">
						<i class="icon jinyunicon icon-search" style="font-size: 1.0rem;"></i>
						<input type="search" id="search" placeholder="输入关键字..." value="">
					</div>
					</div>
			</form>
		</div>
		<div class="fui-header-right" data-nomenu="true">
			<a href="javascript:;"><i class="icon jinyunicon icon-saoyisao2" id="listblock" style="font-size: 1.0rem;"></i></a>
		</div>
</div>
<div class="fui-content" style="top:1.3rem">
		<div class="weui_cells weui_cells_access">
				<a class="weui_cell" href="javascript:;">
					<div class="weui_cell_bd weui_cell_primary" style="padding:0">
						<span>当前定位/选择地区：{{pagedata.params.city || '广州市'}}</span>
					</div>
				</a>
			</div>
			<div class="weui_cells_title">热门地区</div>
			<div class="weui_cells">
				<div class="row margin0">
					<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('广东省','深圳市','');pagedata.showcity = 0;">
									<div>深圳市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('上海市','上海市','');pagedata.showcity = 0;">
									<div>上海市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('广东省','东莞市','');pagedata.showcity = 0;">
									<div>东莞市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('北京市','北京市','');pagedata.showcity = 0;">
									<div>北京市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('江苏省','南京市','');pagedata.showcity = 0;">
									<div>南京市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('江苏省','杭州市','');pagedata.showcity = 0;">
									<div>杭州市</div>
									<div class="clear"></div>
							</div>
						</div>
				</div>
			</div>
			<div ng-repeat="(value,data) in pagedata.province">
				<div class="weui_cells_title">{{value}}</div>
				<div class="weui_cells">
					<div class="row margin0">
						<div class="jy-3" ng-repeat="(city,data) in pagedata.province[value]">
								<div class="yuyue-duan" style="width:auto" ng-click="selectarea(value,city,'');pagedata.showcity = 0;">
										<div>{{city}}</div>
										<div class="clear"></div>
								</div>
						</div>
					</div>
				</div>
		    </div>
</div>
</div>
<script>
scope.selectarea = function(province,city,district){
	scope.pagedata.params.province = province;
	scope.pagedata.params.city = city;
	scope.pagedata.params.district = district;
	scope.post_json('jy_kongtiaoshop/get_data/getareas/',{'lat_lng':scope.main.lat_lng,'province':province,'city':city},function(res){
			scope.pagedata.areas =res.areas
			scope.pagedata.areas_count =res.areas_count
			scope.$evalAsync();
	});
}	
scope.pagedata.getprovince=function(){
	scope.get('core/member.set/getprovince/',function(res){
		scope.pagedata.province=res.province;
		scope.$evalAsync();
	});
}
scope.pagedata.getprovince();
</script>